﻿
#region Using directives

using System;
using System.Collections;
using System.Collections.Specialized;


using System.Web.Configuration;
using System.Data;
using System.Data.Common;
using System.Configuration.Provider;

using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;

using NiSis.Entities;
using NiSis.Data;
using NiSis.Data.Bases;

#endregion

namespace NiSis.Data.SqlClient
{
	/// <summary>
	/// This class is the Sql implementation of the NetTiersProvider.
	/// </summary>
	public sealed class SqlNetTiersProvider : NiSis.Data.Bases.NetTiersProvider
	{
		private static object syncRoot = new Object();
		private string _applicationName;
        private string _connectionString;
        private bool _useStoredProcedure;
        string _providerInvariantName;
		
		/// <summary>
		/// Initializes a new instance of the <see cref="SqlNetTiersProvider"/> class.
		///</summary>
		public SqlNetTiersProvider()
		{	
		}		
		
		/// <summary>
        /// Initializes the provider.
        /// </summary>
        /// <param name="name">The friendly name of the provider.</param>
        /// <param name="config">A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider.</param>
        /// <exception cref="T:System.ArgumentNullException">The name of the provider is null.</exception>
        /// <exception cref="T:System.InvalidOperationException">An attempt is made to call <see cref="M:System.Configuration.Provider.ProviderBase.Initialize(System.String,System.Collections.Specialized.NameValueCollection)"></see> on a provider after the provider has already been initialized.</exception>
        /// <exception cref="T:System.ArgumentException">The name of the provider has a length of zero.</exception>
		public override void Initialize(string name, NameValueCollection config)
        {
            // Verify that config isn't null
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            // Assign the provider a default name if it doesn't have one
            if (String.IsNullOrEmpty(name))
            {
                name = "SqlNetTiersProvider";
            }

            // Add a default "description" attribute to config if the
            // attribute doesn't exist or is empty
            if (string.IsNullOrEmpty(config["description"]))
            {
                config.Remove("description");
                config.Add("description", "NetTiers Sql provider");
            }

            // Call the base class's Initialize method
            base.Initialize(name, config);

            // Initialize _applicationName
            _applicationName = config["applicationName"];

            if (string.IsNullOrEmpty(_applicationName))
            {
                _applicationName = "/";
            }
            config.Remove("applicationName");


            #region "Initialize UseStoredProcedure"
            string storedProcedure  = config["useStoredProcedure"];
           	if (string.IsNullOrEmpty(storedProcedure))
            {
                throw new ProviderException("Empty or missing useStoredProcedure");
            }
            this._useStoredProcedure = Convert.ToBoolean(config["useStoredProcedure"]);
            config.Remove("useStoredProcedure");
            #endregion

			#region ConnectionString

			// Initialize _connectionString
			_connectionString = config["connectionString"];
			config.Remove("connectionString");

			string connect = config["connectionStringName"];
			config.Remove("connectionStringName");

			if ( String.IsNullOrEmpty(_connectionString) )
			{
				if ( String.IsNullOrEmpty(connect) )
				{
					throw new ProviderException("Empty or missing connectionStringName");
				}

				if ( DataRepository.ConnectionStrings[connect] == null )
				{
					throw new ProviderException("Missing connection string");
				}

				_connectionString = DataRepository.ConnectionStrings[connect].ConnectionString;
			}

            if ( String.IsNullOrEmpty(_connectionString) )
            {
                throw new ProviderException("Empty connection string");
			}

			#endregion
            
             #region "_providerInvariantName"

            // initialize _providerInvariantName
            this._providerInvariantName = config["providerInvariantName"];

            if (String.IsNullOrEmpty(_providerInvariantName))
            {
                throw new ProviderException("Empty or missing providerInvariantName");
            }
            config.Remove("providerInvariantName");

            #endregion

        }
		
		/// <summary>
		/// Creates a new <c cref="TransactionManager"/> instance from the current datasource.
		/// </summary>
		/// <returns></returns>
		public override TransactionManager CreateTransaction()
		{
			return new TransactionManager(this._connectionString);
		}
		
		/// <summary>
		/// Gets a value indicating whether to use stored procedure or not.
		/// </summary>
		/// <value>
		/// 	<c>true</c> if this repository use stored procedures; otherwise, <c>false</c>.
		/// </value>
		public bool UseStoredProcedure
		{
			get {return this._useStoredProcedure;}
			set {this._useStoredProcedure = value;}
		}
		
		 /// <summary>
        /// Gets or sets the connection string.
        /// </summary>
        /// <value>The connection string.</value>
		public string ConnectionString
		{
			get {return this._connectionString;}
			set {this._connectionString = value;}
		}
		
		/// <summary>
	    /// Gets or sets the invariant provider name listed in the DbProviderFactories machine.config section.
	    /// </summary>
	    /// <value>The name of the provider invariant.</value>
	    public string ProviderInvariantName
	    {
	        get { return this._providerInvariantName; }
	        set { this._providerInvariantName = value; }
	    }		
		
		///<summary>
		/// Indicates if the current <c cref="NetTiersProvider"/> implementation supports Transacton.
		///</summary>
		public override bool IsTransactionSupported
		{
			get
			{
				return true;
			}
		}

		
		#region "SshComuniProvider"
			
		private SqlSshComuniProvider innerSqlSshComuniProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshComuni"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshComuniProviderBase SshComuniProvider
		{
			get
			{
				if (innerSqlSshComuniProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshComuniProvider == null)
						{
							this.innerSqlSshComuniProvider = new SqlSshComuniProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshComuniProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshComuniProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshComuniProvider SqlSshComuniProvider
		{
			get {return SshComuniProvider as SqlSshComuniProvider;}
		}
		
		#endregion
		
		
		#region "SshTipologiaSocietaProvider"
			
		private SqlSshTipologiaSocietaProvider innerSqlSshTipologiaSocietaProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshTipologiaSocieta"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshTipologiaSocietaProviderBase SshTipologiaSocietaProvider
		{
			get
			{
				if (innerSqlSshTipologiaSocietaProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshTipologiaSocietaProvider == null)
						{
							this.innerSqlSshTipologiaSocietaProvider = new SqlSshTipologiaSocietaProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshTipologiaSocietaProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshTipologiaSocietaProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshTipologiaSocietaProvider SqlSshTipologiaSocietaProvider
		{
			get {return SshTipologiaSocietaProvider as SqlSshTipologiaSocietaProvider;}
		}
		
		#endregion
		
		
		#region "SshTraderPrecStoricoProvider"
			
		private SqlSshTraderPrecStoricoProvider innerSqlSshTraderPrecStoricoProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshTraderPrecStorico"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshTraderPrecStoricoProviderBase SshTraderPrecStoricoProvider
		{
			get
			{
				if (innerSqlSshTraderPrecStoricoProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshTraderPrecStoricoProvider == null)
						{
							this.innerSqlSshTraderPrecStoricoProvider = new SqlSshTraderPrecStoricoProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshTraderPrecStoricoProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshTraderPrecStoricoProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshTraderPrecStoricoProvider SqlSshTraderPrecStoricoProvider
		{
			get {return SshTraderPrecStoricoProvider as SqlSshTraderPrecStoricoProvider;}
		}
		
		#endregion
		
		
		#region "SshPeriodiFornituraProvider"
			
		private SqlSshPeriodiFornituraProvider innerSqlSshPeriodiFornituraProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshPeriodiFornitura"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshPeriodiFornituraProviderBase SshPeriodiFornituraProvider
		{
			get
			{
				if (innerSqlSshPeriodiFornituraProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshPeriodiFornituraProvider == null)
						{
							this.innerSqlSshPeriodiFornituraProvider = new SqlSshPeriodiFornituraProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshPeriodiFornituraProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshPeriodiFornituraProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshPeriodiFornituraProvider SqlSshPeriodiFornituraProvider
		{
			get {return SshPeriodiFornituraProvider as SqlSshPeriodiFornituraProvider;}
		}
		
		#endregion
		
		
		#region "SshRelazioniSocietarieProvider"
			
		private SqlSshRelazioniSocietarieProvider innerSqlSshRelazioniSocietarieProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshRelazioniSocietarie"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshRelazioniSocietarieProviderBase SshRelazioniSocietarieProvider
		{
			get
			{
				if (innerSqlSshRelazioniSocietarieProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshRelazioniSocietarieProvider == null)
						{
							this.innerSqlSshRelazioniSocietarieProvider = new SqlSshRelazioniSocietarieProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshRelazioniSocietarieProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshRelazioniSocietarieProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshRelazioniSocietarieProvider SqlSshRelazioniSocietarieProvider
		{
			get {return SshRelazioniSocietarieProvider as SqlSshRelazioniSocietarieProvider;}
		}
		
		#endregion
		
		
		#region "SshBatchRelazioniProvider"
			
		private SqlSshBatchRelazioniProvider innerSqlSshBatchRelazioniProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshBatchRelazioni"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshBatchRelazioniProviderBase SshBatchRelazioniProvider
		{
			get
			{
				if (innerSqlSshBatchRelazioniProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshBatchRelazioniProvider == null)
						{
							this.innerSqlSshBatchRelazioniProvider = new SqlSshBatchRelazioniProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshBatchRelazioniProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshBatchRelazioniProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshBatchRelazioniProvider SqlSshBatchRelazioniProvider
		{
			get {return SshBatchRelazioniProvider as SqlSshBatchRelazioniProvider;}
		}
		
		#endregion
		
		
		#region "SshPoolStateProvider"
			
		private SqlSshPoolStateProvider innerSqlSshPoolStateProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshPoolState"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshPoolStateProviderBase SshPoolStateProvider
		{
			get
			{
				if (innerSqlSshPoolStateProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshPoolStateProvider == null)
						{
							this.innerSqlSshPoolStateProvider = new SqlSshPoolStateProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshPoolStateProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshPoolStateProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshPoolStateProvider SqlSshPoolStateProvider
		{
			get {return SshPoolStateProvider as SqlSshPoolStateProvider;}
		}
		
		#endregion
		
		
		#region "SshUtenzeGasStoricoProvider"
			
		private SqlSshUtenzeGasStoricoProvider innerSqlSshUtenzeGasStoricoProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshUtenzeGasStorico"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshUtenzeGasStoricoProviderBase SshUtenzeGasStoricoProvider
		{
			get
			{
				if (innerSqlSshUtenzeGasStoricoProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshUtenzeGasStoricoProvider == null)
						{
							this.innerSqlSshUtenzeGasStoricoProvider = new SqlSshUtenzeGasStoricoProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshUtenzeGasStoricoProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshUtenzeGasStoricoProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshUtenzeGasStoricoProvider SqlSshUtenzeGasStoricoProvider
		{
			get {return SshUtenzeGasStoricoProvider as SqlSshUtenzeGasStoricoProvider;}
		}
		
		#endregion
		
		
		#region "SshShipperAttiviSuPoolProvider"
			
		private SqlSshShipperAttiviSuPoolProvider innerSqlSshShipperAttiviSuPoolProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshShipperAttiviSuPool"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshShipperAttiviSuPoolProviderBase SshShipperAttiviSuPoolProvider
		{
			get
			{
				if (innerSqlSshShipperAttiviSuPoolProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshShipperAttiviSuPoolProvider == null)
						{
							this.innerSqlSshShipperAttiviSuPoolProvider = new SqlSshShipperAttiviSuPoolProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshShipperAttiviSuPoolProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshShipperAttiviSuPoolProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshShipperAttiviSuPoolProvider SqlSshShipperAttiviSuPoolProvider
		{
			get {return SshShipperAttiviSuPoolProvider as SqlSshShipperAttiviSuPoolProvider;}
		}
		
		#endregion
		
		
		#region "SshStatoRelazioniProvider"
			
		private SqlSshStatoRelazioniProvider innerSqlSshStatoRelazioniProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshStatoRelazioni"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshStatoRelazioniProviderBase SshStatoRelazioniProvider
		{
			get
			{
				if (innerSqlSshStatoRelazioniProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshStatoRelazioniProvider == null)
						{
							this.innerSqlSshStatoRelazioniProvider = new SqlSshStatoRelazioniProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshStatoRelazioniProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshStatoRelazioniProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshStatoRelazioniProvider SqlSshStatoRelazioniProvider
		{
			get {return SshStatoRelazioniProvider as SqlSshStatoRelazioniProvider;}
		}
		
		#endregion
		
		
		#region "SshSocietaStoricoChainProvider"
			
		private SqlSshSocietaStoricoChainProvider innerSqlSshSocietaStoricoChainProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshSocietaStoricoChain"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshSocietaStoricoChainProviderBase SshSocietaStoricoChainProvider
		{
			get
			{
				if (innerSqlSshSocietaStoricoChainProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshSocietaStoricoChainProvider == null)
						{
							this.innerSqlSshSocietaStoricoChainProvider = new SqlSshSocietaStoricoChainProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshSocietaStoricoChainProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshSocietaStoricoChainProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshSocietaStoricoChainProvider SqlSshSocietaStoricoChainProvider
		{
			get {return SshSocietaStoricoChainProvider as SqlSshSocietaStoricoChainProvider;}
		}
		
		#endregion
		
		
		#region "SshUtenzeGasProvider"
			
		private SqlSshUtenzeGasProvider innerSqlSshUtenzeGasProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshUtenzeGas"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshUtenzeGasProviderBase SshUtenzeGasProvider
		{
			get
			{
				if (innerSqlSshUtenzeGasProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshUtenzeGasProvider == null)
						{
							this.innerSqlSshUtenzeGasProvider = new SqlSshUtenzeGasProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshUtenzeGasProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshUtenzeGasProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshUtenzeGasProvider SqlSshUtenzeGasProvider
		{
			get {return SshUtenzeGasProvider as SqlSshUtenzeGasProvider;}
		}
		
		#endregion
		
		
		#region "SshNewSocietaProvider"
			
		private SqlSshNewSocietaProvider innerSqlSshNewSocietaProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshNewSocieta"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshNewSocietaProviderBase SshNewSocietaProvider
		{
			get
			{
				if (innerSqlSshNewSocietaProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshNewSocietaProvider == null)
						{
							this.innerSqlSshNewSocietaProvider = new SqlSshNewSocietaProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshNewSocietaProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshNewSocietaProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshNewSocietaProvider SqlSshNewSocietaProvider
		{
			get {return SshNewSocietaProvider as SqlSshNewSocietaProvider;}
		}
		
		#endregion
		
		
		#region "SshTipologPrelievoAeegProvider"
			
		private SqlSshTipologPrelievoAeegProvider innerSqlSshTipologPrelievoAeegProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshTipologPrelievoAeeg"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshTipologPrelievoAeegProviderBase SshTipologPrelievoAeegProvider
		{
			get
			{
				if (innerSqlSshTipologPrelievoAeegProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshTipologPrelievoAeegProvider == null)
						{
							this.innerSqlSshTipologPrelievoAeegProvider = new SqlSshTipologPrelievoAeegProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshTipologPrelievoAeegProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshTipologPrelievoAeegProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshTipologPrelievoAeegProvider SqlSshTipologPrelievoAeegProvider
		{
			get {return SshTipologPrelievoAeegProvider as SqlSshTipologPrelievoAeegProvider;}
		}
		
		#endregion
		
		
		#region "SshPoolProvider"
			
		private SqlSshPoolProvider innerSqlSshPoolProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshPool"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshPoolProviderBase SshPoolProvider
		{
			get
			{
				if (innerSqlSshPoolProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshPoolProvider == null)
						{
							this.innerSqlSshPoolProvider = new SqlSshPoolProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshPoolProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshPoolProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshPoolProvider SqlSshPoolProvider
		{
			get {return SshPoolProvider as SqlSshPoolProvider;}
		}
		
		#endregion
		
		
		#region "SshNewRelazioniSocietarieProvider"
			
		private SqlSshNewRelazioniSocietarieProvider innerSqlSshNewRelazioniSocietarieProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshNewRelazioniSocietarie"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshNewRelazioniSocietarieProviderBase SshNewRelazioniSocietarieProvider
		{
			get
			{
				if (innerSqlSshNewRelazioniSocietarieProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshNewRelazioniSocietarieProvider == null)
						{
							this.innerSqlSshNewRelazioniSocietarieProvider = new SqlSshNewRelazioniSocietarieProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshNewRelazioniSocietarieProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshNewRelazioniSocietarieProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshNewRelazioniSocietarieProvider SqlSshNewRelazioniSocietarieProvider
		{
			get {return SshNewRelazioniSocietarieProvider as SqlSshNewRelazioniSocietarieProvider;}
		}
		
		#endregion
		
		
		#region "SshSocietaProvider"
			
		private SqlSshSocietaProvider innerSqlSshSocietaProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SshSocieta"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SshSocietaProviderBase SshSocietaProvider
		{
			get
			{
				if (innerSqlSshSocietaProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlSshSocietaProvider == null)
						{
							this.innerSqlSshSocietaProvider = new SqlSshSocietaProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlSshSocietaProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlSshSocietaProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlSshSocietaProvider SqlSshSocietaProvider
		{
			get {return SshSocietaProvider as SqlSshSocietaProvider;}
		}
		
		#endregion
		
		
		
		#region "VAllShippersProvider"
		
		private SqlVAllShippersProvider innerSqlVAllShippersProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VAllShippers"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VAllShippersProviderBase VAllShippersProvider
		{
			get
			{
				if (innerSqlVAllShippersProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVAllShippersProvider == null)
						{
							this.innerSqlVAllShippersProvider = new SqlVAllShippersProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVAllShippersProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVAllShippersProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVAllShippersProvider SqlVAllShippersProvider
		{
			get {return VAllShippersProvider as SqlVAllShippersProvider;}
		}
		
		#endregion
		
		
		#region "VBatchTraderPrecProvider"
		
		private SqlVBatchTraderPrecProvider innerSqlVBatchTraderPrecProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VBatchTraderPrec"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VBatchTraderPrecProviderBase VBatchTraderPrecProvider
		{
			get
			{
				if (innerSqlVBatchTraderPrecProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVBatchTraderPrecProvider == null)
						{
							this.innerSqlVBatchTraderPrecProvider = new SqlVBatchTraderPrecProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVBatchTraderPrecProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVBatchTraderPrecProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVBatchTraderPrecProvider SqlVBatchTraderPrecProvider
		{
			get {return VBatchTraderPrecProvider as SqlVBatchTraderPrecProvider;}
		}
		
		#endregion
		
		
		#region "VBatchTraderPrecStProvider"
		
		private SqlVBatchTraderPrecStProvider innerSqlVBatchTraderPrecStProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VBatchTraderPrecSt"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VBatchTraderPrecStProviderBase VBatchTraderPrecStProvider
		{
			get
			{
				if (innerSqlVBatchTraderPrecStProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVBatchTraderPrecStProvider == null)
						{
							this.innerSqlVBatchTraderPrecStProvider = new SqlVBatchTraderPrecStProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVBatchTraderPrecStProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVBatchTraderPrecStProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVBatchTraderPrecStProvider SqlVBatchTraderPrecStProvider
		{
			get {return VBatchTraderPrecStProvider as SqlVBatchTraderPrecStProvider;}
		}
		
		#endregion
		
		
		#region "VBatchTraderPrecStPoolProvider"
		
		private SqlVBatchTraderPrecStPoolProvider innerSqlVBatchTraderPrecStPoolProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VBatchTraderPrecStPool"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VBatchTraderPrecStPoolProviderBase VBatchTraderPrecStPoolProvider
		{
			get
			{
				if (innerSqlVBatchTraderPrecStPoolProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVBatchTraderPrecStPoolProvider == null)
						{
							this.innerSqlVBatchTraderPrecStPoolProvider = new SqlVBatchTraderPrecStPoolProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVBatchTraderPrecStPoolProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVBatchTraderPrecStPoolProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVBatchTraderPrecStPoolProvider SqlVBatchTraderPrecStPoolProvider
		{
			get {return VBatchTraderPrecStPoolProvider as SqlVBatchTraderPrecStPoolProvider;}
		}
		
		#endregion
		
		
		#region "VBatchUtenzeProvider"
		
		private SqlVBatchUtenzeProvider innerSqlVBatchUtenzeProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VBatchUtenze"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VBatchUtenzeProviderBase VBatchUtenzeProvider
		{
			get
			{
				if (innerSqlVBatchUtenzeProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVBatchUtenzeProvider == null)
						{
							this.innerSqlVBatchUtenzeProvider = new SqlVBatchUtenzeProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVBatchUtenzeProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVBatchUtenzeProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVBatchUtenzeProvider SqlVBatchUtenzeProvider
		{
			get {return VBatchUtenzeProvider as SqlVBatchUtenzeProvider;}
		}
		
		#endregion
		
		
		#region "VCdMeseProvider"
		
		private SqlVCdMeseProvider innerSqlVCdMeseProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VCdMese"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VCdMeseProviderBase VCdMeseProvider
		{
			get
			{
				if (innerSqlVCdMeseProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVCdMeseProvider == null)
						{
							this.innerSqlVCdMeseProvider = new SqlVCdMeseProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVCdMeseProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVCdMeseProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVCdMeseProvider SqlVCdMeseProvider
		{
			get {return VCdMeseProvider as SqlVCdMeseProvider;}
		}
		
		#endregion
		
		
		#region "VCdMeseAllProvider"
		
		private SqlVCdMeseAllProvider innerSqlVCdMeseAllProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VCdMeseAll"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VCdMeseAllProviderBase VCdMeseAllProvider
		{
			get
			{
				if (innerSqlVCdMeseAllProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVCdMeseAllProvider == null)
						{
							this.innerSqlVCdMeseAllProvider = new SqlVCdMeseAllProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVCdMeseAllProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVCdMeseAllProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVCdMeseAllProvider SqlVCdMeseAllProvider
		{
			get {return VCdMeseAllProvider as SqlVCdMeseAllProvider;}
		}
		
		#endregion
		
		
		#region "VConsolidaUtenzeProvider"
		
		private SqlVConsolidaUtenzeProvider innerSqlVConsolidaUtenzeProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VConsolidaUtenze"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VConsolidaUtenzeProviderBase VConsolidaUtenzeProvider
		{
			get
			{
				if (innerSqlVConsolidaUtenzeProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVConsolidaUtenzeProvider == null)
						{
							this.innerSqlVConsolidaUtenzeProvider = new SqlVConsolidaUtenzeProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVConsolidaUtenzeProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVConsolidaUtenzeProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVConsolidaUtenzeProvider SqlVConsolidaUtenzeProvider
		{
			get {return VConsolidaUtenzeProvider as SqlVConsolidaUtenzeProvider;}
		}
		
		#endregion
		
		
		#region "VIntersecRelazioniSocietarieProvider"
		
		private SqlVIntersecRelazioniSocietarieProvider innerSqlVIntersecRelazioniSocietarieProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VIntersecRelazioniSocietarie"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VIntersecRelazioniSocietarieProviderBase VIntersecRelazioniSocietarieProvider
		{
			get
			{
				if (innerSqlVIntersecRelazioniSocietarieProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVIntersecRelazioniSocietarieProvider == null)
						{
							this.innerSqlVIntersecRelazioniSocietarieProvider = new SqlVIntersecRelazioniSocietarieProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVIntersecRelazioniSocietarieProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVIntersecRelazioniSocietarieProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVIntersecRelazioniSocietarieProvider SqlVIntersecRelazioniSocietarieProvider
		{
			get {return VIntersecRelazioniSocietarieProvider as SqlVIntersecRelazioniSocietarieProvider;}
		}
		
		#endregion
		
		
		#region "VIntersecShipperAttiviPoolProvider"
		
		private SqlVIntersecShipperAttiviPoolProvider innerSqlVIntersecShipperAttiviPoolProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VIntersecShipperAttiviPool"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VIntersecShipperAttiviPoolProviderBase VIntersecShipperAttiviPoolProvider
		{
			get
			{
				if (innerSqlVIntersecShipperAttiviPoolProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVIntersecShipperAttiviPoolProvider == null)
						{
							this.innerSqlVIntersecShipperAttiviPoolProvider = new SqlVIntersecShipperAttiviPoolProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVIntersecShipperAttiviPoolProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVIntersecShipperAttiviPoolProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVIntersecShipperAttiviPoolProvider SqlVIntersecShipperAttiviPoolProvider
		{
			get {return VIntersecShipperAttiviPoolProvider as SqlVIntersecShipperAttiviPoolProvider;}
		}
		
		#endregion
		
		
		#region "VIntersecShipperFilterProvider"
		
		private SqlVIntersecShipperFilterProvider innerSqlVIntersecShipperFilterProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VIntersecShipperFilter"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VIntersecShipperFilterProviderBase VIntersecShipperFilterProvider
		{
			get
			{
				if (innerSqlVIntersecShipperFilterProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVIntersecShipperFilterProvider == null)
						{
							this.innerSqlVIntersecShipperFilterProvider = new SqlVIntersecShipperFilterProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVIntersecShipperFilterProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVIntersecShipperFilterProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVIntersecShipperFilterProvider SqlVIntersecShipperFilterProvider
		{
			get {return VIntersecShipperFilterProvider as SqlVIntersecShipperFilterProvider;}
		}
		
		#endregion
		
		
		#region "VNewRelazioniSocietarieProvider"
		
		private SqlVNewRelazioniSocietarieProvider innerSqlVNewRelazioniSocietarieProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VNewRelazioniSocietarie"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VNewRelazioniSocietarieProviderBase VNewRelazioniSocietarieProvider
		{
			get
			{
				if (innerSqlVNewRelazioniSocietarieProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVNewRelazioniSocietarieProvider == null)
						{
							this.innerSqlVNewRelazioniSocietarieProvider = new SqlVNewRelazioniSocietarieProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVNewRelazioniSocietarieProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVNewRelazioniSocietarieProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVNewRelazioniSocietarieProvider SqlVNewRelazioniSocietarieProvider
		{
			get {return VNewRelazioniSocietarieProvider as SqlVNewRelazioniSocietarieProvider;}
		}
		
		#endregion
		
		
		#region "VNewSocietaProvider"
		
		private SqlVNewSocietaProvider innerSqlVNewSocietaProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VNewSocieta"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VNewSocietaProviderBase VNewSocietaProvider
		{
			get
			{
				if (innerSqlVNewSocietaProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVNewSocietaProvider == null)
						{
							this.innerSqlVNewSocietaProvider = new SqlVNewSocietaProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVNewSocietaProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVNewSocietaProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVNewSocietaProvider SqlVNewSocietaProvider
		{
			get {return VNewSocietaProvider as SqlVNewSocietaProvider;}
		}
		
		#endregion
		
		
		#region "VPoolProvider"
		
		private SqlVPoolProvider innerSqlVPoolProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VPool"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VPoolProviderBase VPoolProvider
		{
			get
			{
				if (innerSqlVPoolProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVPoolProvider == null)
						{
							this.innerSqlVPoolProvider = new SqlVPoolProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVPoolProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVPoolProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVPoolProvider SqlVPoolProvider
		{
			get {return VPoolProvider as SqlVPoolProvider;}
		}
		
		#endregion
		
		
		#region "VRejectedShippersProvider"
		
		private SqlVRejectedShippersProvider innerSqlVRejectedShippersProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VRejectedShippers"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VRejectedShippersProviderBase VRejectedShippersProvider
		{
			get
			{
				if (innerSqlVRejectedShippersProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVRejectedShippersProvider == null)
						{
							this.innerSqlVRejectedShippersProvider = new SqlVRejectedShippersProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVRejectedShippersProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVRejectedShippersProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVRejectedShippersProvider SqlVRejectedShippersProvider
		{
			get {return VRejectedShippersProvider as SqlVRejectedShippersProvider;}
		}
		
		#endregion
		
		
		#region "VRelazioniSocietarieProvider"
		
		private SqlVRelazioniSocietarieProvider innerSqlVRelazioniSocietarieProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VRelazioniSocietarie"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VRelazioniSocietarieProviderBase VRelazioniSocietarieProvider
		{
			get
			{
				if (innerSqlVRelazioniSocietarieProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVRelazioniSocietarieProvider == null)
						{
							this.innerSqlVRelazioniSocietarieProvider = new SqlVRelazioniSocietarieProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVRelazioniSocietarieProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVRelazioniSocietarieProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVRelazioniSocietarieProvider SqlVRelazioniSocietarieProvider
		{
			get {return VRelazioniSocietarieProvider as SqlVRelazioniSocietarieProvider;}
		}
		
		#endregion
		
		
		#region "VReportProvider"
		
		private SqlVReportProvider innerSqlVReportProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VReport"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VReportProviderBase VReportProvider
		{
			get
			{
				if (innerSqlVReportProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVReportProvider == null)
						{
							this.innerSqlVReportProvider = new SqlVReportProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVReportProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVReportProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVReportProvider SqlVReportProvider
		{
			get {return VReportProvider as SqlVReportProvider;}
		}
		
		#endregion
		
		
		#region "VShipperAttiviPoolProvider"
		
		private SqlVShipperAttiviPoolProvider innerSqlVShipperAttiviPoolProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VShipperAttiviPool"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VShipperAttiviPoolProviderBase VShipperAttiviPoolProvider
		{
			get
			{
				if (innerSqlVShipperAttiviPoolProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVShipperAttiviPoolProvider == null)
						{
							this.innerSqlVShipperAttiviPoolProvider = new SqlVShipperAttiviPoolProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVShipperAttiviPoolProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVShipperAttiviPoolProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVShipperAttiviPoolProvider SqlVShipperAttiviPoolProvider
		{
			get {return VShipperAttiviPoolProvider as SqlVShipperAttiviPoolProvider;}
		}
		
		#endregion
		
		
		#region "VShipperDefaultPoolProvider"
		
		private SqlVShipperDefaultPoolProvider innerSqlVShipperDefaultPoolProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VShipperDefaultPool"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VShipperDefaultPoolProviderBase VShipperDefaultPoolProvider
		{
			get
			{
				if (innerSqlVShipperDefaultPoolProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVShipperDefaultPoolProvider == null)
						{
							this.innerSqlVShipperDefaultPoolProvider = new SqlVShipperDefaultPoolProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVShipperDefaultPoolProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVShipperDefaultPoolProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVShipperDefaultPoolProvider SqlVShipperDefaultPoolProvider
		{
			get {return VShipperDefaultPoolProvider as SqlVShipperDefaultPoolProvider;}
		}
		
		#endregion
		
		
		#region "VSimpleShipperDefaultPoolProvider"
		
		private SqlVSimpleShipperDefaultPoolProvider innerSqlVSimpleShipperDefaultPoolProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VSimpleShipperDefaultPool"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VSimpleShipperDefaultPoolProviderBase VSimpleShipperDefaultPoolProvider
		{
			get
			{
				if (innerSqlVSimpleShipperDefaultPoolProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVSimpleShipperDefaultPoolProvider == null)
						{
							this.innerSqlVSimpleShipperDefaultPoolProvider = new SqlVSimpleShipperDefaultPoolProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVSimpleShipperDefaultPoolProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVSimpleShipperDefaultPoolProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVSimpleShipperDefaultPoolProvider SqlVSimpleShipperDefaultPoolProvider
		{
			get {return VSimpleShipperDefaultPoolProvider as SqlVSimpleShipperDefaultPoolProvider;}
		}
		
		#endregion
		
		
		#region "VSimpleShipperFilterProvider"
		
		private SqlVSimpleShipperFilterProvider innerSqlVSimpleShipperFilterProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VSimpleShipperFilter"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VSimpleShipperFilterProviderBase VSimpleShipperFilterProvider
		{
			get
			{
				if (innerSqlVSimpleShipperFilterProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVSimpleShipperFilterProvider == null)
						{
							this.innerSqlVSimpleShipperFilterProvider = new SqlVSimpleShipperFilterProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVSimpleShipperFilterProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVSimpleShipperFilterProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVSimpleShipperFilterProvider SqlVSimpleShipperFilterProvider
		{
			get {return VSimpleShipperFilterProvider as SqlVSimpleShipperFilterProvider;}
		}
		
		#endregion
		
		
		#region "VSimpleTraderPrecProvider"
		
		private SqlVSimpleTraderPrecProvider innerSqlVSimpleTraderPrecProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VSimpleTraderPrec"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VSimpleTraderPrecProviderBase VSimpleTraderPrecProvider
		{
			get
			{
				if (innerSqlVSimpleTraderPrecProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVSimpleTraderPrecProvider == null)
						{
							this.innerSqlVSimpleTraderPrecProvider = new SqlVSimpleTraderPrecProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVSimpleTraderPrecProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVSimpleTraderPrecProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVSimpleTraderPrecProvider SqlVSimpleTraderPrecProvider
		{
			get {return VSimpleTraderPrecProvider as SqlVSimpleTraderPrecProvider;}
		}
		
		#endregion
		
		
		#region "VSocietaAllProvider"
		
		private SqlVSocietaAllProvider innerSqlVSocietaAllProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VSocietaAll"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VSocietaAllProviderBase VSocietaAllProvider
		{
			get
			{
				if (innerSqlVSocietaAllProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVSocietaAllProvider == null)
						{
							this.innerSqlVSocietaAllProvider = new SqlVSocietaAllProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVSocietaAllProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVSocietaAllProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVSocietaAllProvider SqlVSocietaAllProvider
		{
			get {return VSocietaAllProvider as SqlVSocietaAllProvider;}
		}
		
		#endregion
		
		
		#region "VSocietaStoricoProvider"
		
		private SqlVSocietaStoricoProvider innerSqlVSocietaStoricoProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VSocietaStorico"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VSocietaStoricoProviderBase VSocietaStoricoProvider
		{
			get
			{
				if (innerSqlVSocietaStoricoProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVSocietaStoricoProvider == null)
						{
							this.innerSqlVSocietaStoricoProvider = new SqlVSocietaStoricoProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVSocietaStoricoProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVSocietaStoricoProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVSocietaStoricoProvider SqlVSocietaStoricoProvider
		{
			get {return VSocietaStoricoProvider as SqlVSocietaStoricoProvider;}
		}
		
		#endregion
		
		
		#region "VTpPoolProvider"
		
		private SqlVTpPoolProvider innerSqlVTpPoolProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VTpPool"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VTpPoolProviderBase VTpPoolProvider
		{
			get
			{
				if (innerSqlVTpPoolProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVTpPoolProvider == null)
						{
							this.innerSqlVTpPoolProvider = new SqlVTpPoolProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVTpPoolProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVTpPoolProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVTpPoolProvider SqlVTpPoolProvider
		{
			get {return VTpPoolProvider as SqlVTpPoolProvider;}
		}
		
		#endregion
		
		
		#region "VTpUtenzeProvider"
		
		private SqlVTpUtenzeProvider innerSqlVTpUtenzeProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VTpUtenze"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VTpUtenzeProviderBase VTpUtenzeProvider
		{
			get
			{
				if (innerSqlVTpUtenzeProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVTpUtenzeProvider == null)
						{
							this.innerSqlVTpUtenzeProvider = new SqlVTpUtenzeProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVTpUtenzeProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVTpUtenzeProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVTpUtenzeProvider SqlVTpUtenzeProvider
		{
			get {return VTpUtenzeProvider as SqlVTpUtenzeProvider;}
		}
		
		#endregion
		
		
		#region "VTpUtenzeAllProvider"
		
		private SqlVTpUtenzeAllProvider innerSqlVTpUtenzeAllProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VTpUtenzeAll"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VTpUtenzeAllProviderBase VTpUtenzeAllProvider
		{
			get
			{
				if (innerSqlVTpUtenzeAllProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVTpUtenzeAllProvider == null)
						{
							this.innerSqlVTpUtenzeAllProvider = new SqlVTpUtenzeAllProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVTpUtenzeAllProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVTpUtenzeAllProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVTpUtenzeAllProvider SqlVTpUtenzeAllProvider
		{
			get {return VTpUtenzeAllProvider as SqlVTpUtenzeAllProvider;}
		}
		
		#endregion
		
		
		#region "VTputenzePoolProvider"
		
		private SqlVTputenzePoolProvider innerSqlVTputenzePoolProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VTputenzePool"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VTputenzePoolProviderBase VTputenzePoolProvider
		{
			get
			{
				if (innerSqlVTputenzePoolProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVTputenzePoolProvider == null)
						{
							this.innerSqlVTputenzePoolProvider = new SqlVTputenzePoolProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVTputenzePoolProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVTputenzePoolProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVTputenzePoolProvider SqlVTputenzePoolProvider
		{
			get {return VTputenzePoolProvider as SqlVTputenzePoolProvider;}
		}
		
		#endregion
		
		
		#region "VTpUtenzeStoricoProvider"
		
		private SqlVTpUtenzeStoricoProvider innerSqlVTpUtenzeStoricoProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VTpUtenzeStorico"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VTpUtenzeStoricoProviderBase VTpUtenzeStoricoProvider
		{
			get
			{
				if (innerSqlVTpUtenzeStoricoProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVTpUtenzeStoricoProvider == null)
						{
							this.innerSqlVTpUtenzeStoricoProvider = new SqlVTpUtenzeStoricoProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVTpUtenzeStoricoProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVTpUtenzeStoricoProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVTpUtenzeStoricoProvider SqlVTpUtenzeStoricoProvider
		{
			get {return VTpUtenzeStoricoProvider as SqlVTpUtenzeStoricoProvider;}
		}
		
		#endregion
		
		
		#region "VTraderInRelationshipProvider"
		
		private SqlVTraderInRelationshipProvider innerSqlVTraderInRelationshipProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VTraderInRelationship"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VTraderInRelationshipProviderBase VTraderInRelationshipProvider
		{
			get
			{
				if (innerSqlVTraderInRelationshipProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVTraderInRelationshipProvider == null)
						{
							this.innerSqlVTraderInRelationshipProvider = new SqlVTraderInRelationshipProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVTraderInRelationshipProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVTraderInRelationshipProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVTraderInRelationshipProvider SqlVTraderInRelationshipProvider
		{
			get {return VTraderInRelationshipProvider as SqlVTraderInRelationshipProvider;}
		}
		
		#endregion
		
		
		#region "VTradersPrecProvider"
		
		private SqlVTradersPrecProvider innerSqlVTradersPrecProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VTradersPrec"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VTradersPrecProviderBase VTradersPrecProvider
		{
			get
			{
				if (innerSqlVTradersPrecProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVTradersPrecProvider == null)
						{
							this.innerSqlVTradersPrecProvider = new SqlVTradersPrecProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVTradersPrecProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVTradersPrecProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVTradersPrecProvider SqlVTradersPrecProvider
		{
			get {return VTradersPrecProvider as SqlVTradersPrecProvider;}
		}
		
		#endregion
		
		
		#region "VUtenzeInPoolProvider"
		
		private SqlVUtenzeInPoolProvider innerSqlVUtenzeInPoolProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VUtenzeInPool"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VUtenzeInPoolProviderBase VUtenzeInPoolProvider
		{
			get
			{
				if (innerSqlVUtenzeInPoolProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVUtenzeInPoolProvider == null)
						{
							this.innerSqlVUtenzeInPoolProvider = new SqlVUtenzeInPoolProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVUtenzeInPoolProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVUtenzeInPoolProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVUtenzeInPoolProvider SqlVUtenzeInPoolProvider
		{
			get {return VUtenzeInPoolProvider as SqlVUtenzeInPoolProvider;}
		}
		
		#endregion
		
		
		#region "VUtenzeNotInPoolProvider"
		
		private SqlVUtenzeNotInPoolProvider innerSqlVUtenzeNotInPoolProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VUtenzeNotInPool"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VUtenzeNotInPoolProviderBase VUtenzeNotInPoolProvider
		{
			get
			{
				if (innerSqlVUtenzeNotInPoolProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVUtenzeNotInPoolProvider == null)
						{
							this.innerSqlVUtenzeNotInPoolProvider = new SqlVUtenzeNotInPoolProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVUtenzeNotInPoolProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVUtenzeNotInPoolProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVUtenzeNotInPoolProvider SqlVUtenzeNotInPoolProvider
		{
			get {return VUtenzeNotInPoolProvider as SqlVUtenzeNotInPoolProvider;}
		}
		
		#endregion
		
		
		#region "VUtenzePoolNonDefinitoProvider"
		
		private SqlVUtenzePoolNonDefinitoProvider innerSqlVUtenzePoolNonDefinitoProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VUtenzePoolNonDefinito"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VUtenzePoolNonDefinitoProviderBase VUtenzePoolNonDefinitoProvider
		{
			get
			{
				if (innerSqlVUtenzePoolNonDefinitoProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerSqlVUtenzePoolNonDefinitoProvider == null)
						{
							this.innerSqlVUtenzePoolNonDefinitoProvider = new SqlVUtenzePoolNonDefinitoProvider(_connectionString, _useStoredProcedure, _providerInvariantName);
						}
					}
				}
				return innerSqlVUtenzePoolNonDefinitoProvider;
			}
		}
		
		/// <summary>
		/// Gets the current <c cref="SqlVUtenzePoolNonDefinitoProvider"/>.
		/// </summary>
		/// <value></value>
		public SqlVUtenzePoolNonDefinitoProvider SqlVUtenzePoolNonDefinitoProvider
		{
			get {return VUtenzePoolNonDefinitoProvider as SqlVUtenzePoolNonDefinitoProvider;}
		}
		
		#endregion
		
		
		#region "General data access methods"

		#region "ExecuteNonQuery"
		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override int ExecuteNonQuery(string storedProcedureName, params object[] parameterValues)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			return database.ExecuteNonQuery(storedProcedureName, parameterValues);	
		}

		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override int ExecuteNonQuery(TransactionManager transactionManager, string storedProcedureName, params object[] parameterValues)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			return database.ExecuteNonQuery(transactionManager.TransactionObject, storedProcedureName, parameterValues);	
		}

		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="commandWrapper">The command wrapper.</param>
		public override void ExecuteNonQuery(DbCommand commandWrapper)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			database.ExecuteNonQuery(commandWrapper);	
			
		}

		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandWrapper">The command wrapper.</param>
		public override void ExecuteNonQuery(TransactionManager transactionManager, DbCommand commandWrapper)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			database.ExecuteNonQuery(commandWrapper, transactionManager.TransactionObject);	
		}


		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override int ExecuteNonQuery(CommandType commandType, string commandText)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			return database.ExecuteNonQuery(commandType, commandText);	
		}
		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override int ExecuteNonQuery(TransactionManager transactionManager, CommandType commandType, string commandText)
		{
			Database database = transactionManager.Database;			
			return database.ExecuteNonQuery(transactionManager.TransactionObject , commandType, commandText);				
		}
		#endregion

		#region "ExecuteDataReader"
		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(string storedProcedureName, params object[] parameterValues)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);			
			return database.ExecuteReader(storedProcedureName, parameterValues);	
		}

		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(TransactionManager transactionManager, string storedProcedureName, params object[] parameterValues)
		{
			Database database = transactionManager.Database;
			return database.ExecuteReader(transactionManager.TransactionObject, storedProcedureName, parameterValues);	
		}

		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(DbCommand commandWrapper)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);			
			return database.ExecuteReader(commandWrapper);	
		}

		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(TransactionManager transactionManager, DbCommand commandWrapper)
		{
			Database database = transactionManager.Database;
			return database.ExecuteReader(commandWrapper, transactionManager.TransactionObject);	
		}


		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(CommandType commandType, string commandText)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			return database.ExecuteReader(commandType, commandText);	
		}
		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(TransactionManager transactionManager, CommandType commandType, string commandText)
		{
			Database database = transactionManager.Database;			
			return database.ExecuteReader(transactionManager.TransactionObject , commandType, commandText);				
		}
		#endregion

		#region "ExecuteDataSet"
		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(string storedProcedureName, params object[] parameterValues)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);			
			return database.ExecuteDataSet(storedProcedureName, parameterValues);	
		}

		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(TransactionManager transactionManager, string storedProcedureName, params object[] parameterValues)
		{
			Database database = transactionManager.Database;
			return database.ExecuteDataSet(transactionManager.TransactionObject, storedProcedureName, parameterValues);	
		}

		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(DbCommand commandWrapper)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);			
			return database.ExecuteDataSet(commandWrapper);	
		}

		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(TransactionManager transactionManager, DbCommand commandWrapper)
		{
			Database database = transactionManager.Database;
			return database.ExecuteDataSet(commandWrapper, transactionManager.TransactionObject);	
		}


		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(CommandType commandType, string commandText)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			return database.ExecuteDataSet(commandType, commandText);	
		}
		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(TransactionManager transactionManager, CommandType commandType, string commandText)
		{
			Database database = transactionManager.Database;			
			return database.ExecuteDataSet(transactionManager.TransactionObject , commandType, commandText);				
		}
		#endregion

		#region "ExecuteScalar"
		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override object ExecuteScalar(string storedProcedureName, params object[] parameterValues)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);			
			return database.ExecuteScalar(storedProcedureName, parameterValues);	
		}

		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override object ExecuteScalar(TransactionManager transactionManager, string storedProcedureName, params object[] parameterValues)
		{
			Database database = transactionManager.Database;
			return database.ExecuteScalar(transactionManager.TransactionObject, storedProcedureName, parameterValues);	
		}

		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override object ExecuteScalar(DbCommand commandWrapper)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);			
			return database.ExecuteScalar(commandWrapper);	
		}

		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override object ExecuteScalar(TransactionManager transactionManager, DbCommand commandWrapper)
		{
			Database database = transactionManager.Database;
			return database.ExecuteScalar(commandWrapper, transactionManager.TransactionObject);	
		}

		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override object ExecuteScalar(CommandType commandType, string commandText)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			return database.ExecuteScalar(commandType, commandText);	
		}
		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override object ExecuteScalar(TransactionManager transactionManager, CommandType commandType, string commandText)
		{
			Database database = transactionManager.Database;			
			return database.ExecuteScalar(transactionManager.TransactionObject , commandType, commandText);				
		}
		#endregion

		#endregion


	}
}
